#ifndef	LTY_LIGHTTYPE_INCLUDES_H
#define LTY_LIGHTTYPE_INCLUDES_H

// ===================================================================================
// Library export settings
// ===================================================================================

#define LTY_DYNAMIC
#ifdef LTY_DYNAMIC
	#ifdef LTY_EXPORT
		#define LTY_API __declspec(dllexport)
	#else
		#define LTY_API __declspec(dllimport)
	#endif
#else
	#define LTY_API
#endif

// ===================================================================================
// LightType classes
// ===================================================================================

namespace Lty {

struct LTY_API IntRect
{
	IntRect() : left(0), top(0), right(0), bottom(0) {}
	IntRect(int l, int t, int r, int b) : left(l), top(t), right(r), bottom(b) {}
	int left, top, right, bottom;
};

struct LTY_API Glyph
{
	int advance;
	IntRect rect;
	IntRect pixelCoords;
};

struct LTY_API FontBitmap
{
	int width, height;
	unsigned int* pixelsRGBA;
};

class LTY_API Font
{
public:
	enum ColorMode {COLOR_ALPHA, COLOR_GRAYSCALE};

	Font();
	~Font();
	bool LoadFromFile(const char* fileName, unsigned int charSize=30, const char* charset=0, int colorMode=COLOR_ALPHA);
	
	unsigned int GetCharSize() const		{return myCharSize;}
	const FontBitmap& GetBitmap() const		{return myBitmap;}
	FontBitmap& GetBitmap()					{return myBitmap;}
	const Glyph& GetGlyph(unsigned char chr) const;
	Glyph& GetGlyph(unsigned char chr);
	
private:
	friend class FontLoader;
	unsigned int myCharSize, myGlyphCount;
	unsigned int myGlyphMap[256];
	FontBitmap myBitmap;
	Glyph* myGlyphs;
};

}; // namespace Lty

#endif /* LTY_LIGHTTYPE_INCLUDES_H */